home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / Caml Light 0.61 / Source / src / lib / sort.mli < prev    next >
Encoding:
Text File  |  1993-09-24  |  685 b   |  14 lines  |  [TEXT/MPS ]

  1. (* Sorting and merging lists *)
  2.  
  3. value sort : ('a -> 'a -> bool) -> 'a list -> 'a list
  4.         (* Sort a list in increasing order according to an ordering predicate.
  5.            The predicate should return [true] if its first argument is
  6.            less than or equal to its second argument. *)
  7.   and merge : ('a -> 'a -> bool) -> 'a list -> 'a list -> 'a list
  8.         (* Merge two lists according to the given predicate.
  9.            Assuming the two argument lists are sorted according to the
  10.            predicate, [merge] returns a sorted list containing the elements
  11.            from the two lists. The behavior is undefined if the two
  12.            argument lists were not sorted. *)
  13. ;;
  14.